<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!--引入css文件-->
    <include file="common_css"/>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>
</head>
<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-12">
                <form method="post" action="__URL__/login.html" id="loginFrom">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到</p>
                    <input type="text" class="form-control uname" placeholder="用户名" />
                    <input type="password" class="form-control pword m-b" placeholder="密码" />
                    <a href="">忘记密码了？</a>
                    <button class="btn btn-success btn-block" id="btn-login">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; hAdmin
            </div>
        </div>
    </div>
</body>
<script>
    var index;
    $("#loginFrom").Validform({/*入金*/
        btnSubmit:"#btn-login",
        ajaxPost:true,
        tiptype: function(msg, o, cssctl) {
            //msg：提示信息;
            //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
            //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
            if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                var objtip = o.obj.parent().siblings(".Validform_checktip");
                cssctl(objtip, o.type);
                objtip.text(msg);
            }
        },beforeSubmit:function(curform){
            index = layer.load();
        },callback:function(data){
            layer.close(index);
            //alert(JSON.stringify(data));return;
            console.log(data);
            if(data.status==1){
                layer.msg(data.msg,{icon: 1, time: 2000});
                //setTimeout("location.href=''",1500);
            }else if(data.status==0){
                layer.msg(data.msg,{icon: 2, time: 2000});
            }else{
                layer.msg('网络错误',{icon: 2, time: 2000});
            }
        }
    });
</script>
</html>
